|
|
|
|
|
|
|
End Property
' Get the current status
Property Get QueryServiceStatus() As ServiceStatus
Dim stat As SERVICE_STATUS
Dim res&
Dim sres As New ServiceStatus
res = intQueryServiceStatus(intServiceHandle, stat)
If res <> 0 Then
' Another way to get a ServiceStatus object
Call sres.InternalInitialize(intServiceName, intDisplayName, stat)
Set QueryServiceStatus = sres
End If
End Property
' Perform Stop, Pause, Continue and Interrogate
Public Function ServiceControl(Operation As ServiceControlConstants) As Long
Dim stat As SERVICE_STATUS
Dim res&
res = intControlService(intServiceHandle, Operation, stat)
ServiceControl = res
End Function
' Perform start
Public Function StartService()
Dim res&
res = intStartService(intServiceHandle, 0, 0)
StartService = res
End Function
' Close the handle on termination
Private Sub Class_Terminate()
If intServiceHandle <> 0 Then
Call CloseServiceHandle(intServiceHandle)
End If
End Sub |
|
|
|
|
|
|
|
|
The Utility Itself
Using the Object Model |
|
|
|
|
|
|
|
|
The original goal of this exercise was to create a utility that would make it easy to stop and then restart the Internet Information Services so that a DLL called by an Active Server Page could be replaced. I wanted to leave it flexible enough to |
|
|
|
|
|